﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="uc_modifypwd.aspx.cs" Inherits="HFWebApp.user.uc_modifypwd" %>
<%@ Register src="../Control/top.ascx" tagname="top" tagprefix="uc1" %>
<%@ Register src="../Control/end.ascx" tagname="end" tagprefix="uc2" %>
<%@ Register src="c_LeftMenu.ascx" tagname="c_LeftMenu" tagprefix="uc3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
<title>用户管理中心_红法网</title>
<link href="<%=this.getDemain %>/Style/Style.css" rel="stylesheet" type="text/css" />
<link href="<%=this.getDemain %>/Style/CenterStyle.css" rel="stylesheet" type="text/css" />
<link href="<%=this.getDemain %>/CSS.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=this.getDemain %>/Scripts/jquery-1.8.0.min.js"></script>
<script type="text/javascript">
    function ModifyPWD() {
        var oldpwd = $("#nowPwd");
        var newpwd = $("#newPWD");
        var newpwd2 = $("#newPWD2");
        if (oldpwd.val() == "") {
            alert('请填写当前密码');
            oldpwd.focus();
            return false;
        }
        if (newpwd.val() == "") {
            alert('请填写要修改的密码');
            newpwd.focus();
            return false;
        }
        if (newpwd2.val() == "") {
            alert('请填写验证密码');
            newpwd2.focus();
            return false;
        }
        if (newpwd2.val() != newpwd.val()) {
            alert('两次输入的密码不一致');
            newpwd2.focus();
            return false;
        }

        $.getJSON(
            "/AjaxSource/UserModify.ashx",
            {
                NowPWD : oldpwd.val() ,
                PWD : newpwd.val() ,
                action : "1" ,
                rand : Math.floor(Math.random() * 10000).toString()
            },
            function (jsonData) { 
                if(jsonData.isTrue)
                {
                    alert(jsonData.Message);
                    oldpwd.val("");
                    newpwd.val("");
                    newpwd2.val("");
                }else{
                    alert(jsonData.Message);
                }
            }
        );

        return false;
    }
</script>
</head>

<body>
<uc1:top ID="top1" MenuClassID="1" focusLink1="focusLink" runat="server" />
<div id="c_BodyBox">
    <div class="c_LeftMenu">
        <uc3:c_LeftMenu ID="c_LeftMenu1" runat="server" />
    </div>
    <div class="c_RightContent">
        <h3>修改密码</h3>
        <div class="c_MessageBox">
            <ul>
            <form id="modifyForm" onsubmit="return ModifyPWD();">
                <li>
                    <div class="c_MB_Left">当前密码</div>
                    <div class="c_MB_Mid"><input name="nowPwd" type="password" id="nowPwd" value="" size="32" /></div>
                    <div class="c_MB_Right"></div>
                </li>
                <li>
                    <div class="c_MB_Left">新密码</div>
                    <div class="c_MB_Mid"><input name="newPWD" type="password" id="newPWD" value="" size="32" /></div>
                    <div class="c_MB_Right"></div>
                </li>
                <li>
                    <div class="c_MB_Left">确认新密码</div>
                    <div class="c_MB_Mid"><input name="newPWD2" type="password" id="newPWD2" value="" size="32" /></div>
                    <div class="c_MB_Right"></div>
                </li>
                <li>
                    <div class="c_MB_Left"></div>
                    <div class="c_MB_Mid"><input id="Button1" type="submit" value="保存" /></div>
                    <div class="c_MB_Right"></div>
                </li>
            </form>
            </ul>
        </div>
    </div>
</div>
<uc2:end ID="end1" runat="server" />
</body>
</html>
